Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BENCH: Add cycle flux benchmark #114

Merged
merged 1 commit into from
Aug 18, 2024
Merged

BENCH: Add cycle flux benchmark #114

merged 1 commit into from
Aug 18, 2024

Conversation

nawtrey
Copy link
Collaborator

@nawtrey nawtrey commented Aug 18, 2024

Description

I'm adding a benchmark for calc_net_cycle_flux since future changes will likely affect its performance, and it would be good to know how well (or poorly) it is performing beforehand.

Here are the results of the new benchmarks from a local run:

$ asv run -b CycleFlux*
Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
▒ Creating environments
▒ Discovering benchmarks
▒▒ Uninstalling from conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy
▒▒ Building 5349eb49 <add_cycle_flux_bench> for conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy
▒▒ Installing 5349eb49 <add_cycle_flux_bench> into conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy
▒ Running 2 total benchmarks (1 commits * 1 environments * 2 benchmarks)
[ 0.00%] ▒ For kda commit 5349eb49 <add_cycle_flux_bench>:
[ 0.00%] ▒▒ Benchmarking conda-py3.9-pip+networkx-pip+numpy-pip+pytest-pip+sympy
[50.00%] ▒▒▒ Running (bench_calculations.CycleFlux.time_calc_net_cycle_flux--).
[75.00%] ▒▒▒ ...ations.CycleFlux.peakmem_calc_net_cycle_flux                ok
[75.00%] ▒▒▒ ============== ======= =======
             --              output_strings
             -------------- ---------------
                 graph        True   False
             ============== ======= =======
                3-state      73.3M   72.2M
              Hill-5-state   74.9M   72.6M
              Hill-8-state   83.2M   72.7M
             ============== ======= =======

[100.00%] ▒▒▒ ...culations.CycleFlux.time_calc_net_cycle_flux                ok
[100.00%] ▒▒▒ ============== ============= =============
              --                    output_strings
              -------------- ---------------------------
                  graph           True         False
              ============== ============= =============
                 3-state      1.80~0.01ms     756~30us
               Hill-5-state    22.6▒0.2ms   7.52▒0.05ms
               Hill-8-state    8.07▒0.02s    70.7▒0.8ms
              ============== ============= =============

I'll just note that I chose not to add the EmrE-8-state model here because it 1.) results in a RecursionError and 2.) takes absolutely forever. The Hill 8-state model is already plenty complex to capture the [lack of] performance here, so I didn't think it was worth the hassle.

Changes

  • Adds new benchmarks for the calculations.calc_net_cycle_flux function.
    Benchmark calculates the net cycle flux for
    all cycles in each diagram so it will scale
    not only with performance, but also with
    the number of cycles.

* Adds new benchmarks for the
`calculations.calc_net_cycle_flux` function.
Benchmark calculates the net cycle flux for
all cycles in each diagram so it will scale
not only with performance, but also with
the number of cycles.
@nawtrey nawtrey added the benchmarks Related to `asv` benchmarks label Aug 18, 2024
@nawtrey
Copy link
Collaborator Author

nawtrey commented Aug 18, 2024

I'll just mention #108 here since it is arguably related.

This doesn't affect any tests or other CI things, and runs locally. Merging.

@nawtrey nawtrey merged commit 0752279 into master Aug 18, 2024
6 checks passed
@nawtrey nawtrey deleted the add_cycle_flux_bench branch August 18, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks Related to `asv` benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant